﻿namespace WMS6.Web.Common
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;
    using WMS6.Web.CommonMethodServiceRef;

    public class LpnGenerate : BasePage
    {
        protected Button btnGenerate;
        protected HtmlGenericControl divMsg;
        protected HtmlForm form1;
        protected HtmlInputHidden hdnActionID;
        protected HtmlHead Head1;
        protected Label Label1;
        protected Label Label2;
        protected Label lblMsg;
        protected HtmlLink mycss;
        protected HtmlInputButton Submit1;
        protected TextBox txtCount;

        protected void btnGenerate_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.txtCount.Text))
            {
                try
                {
                    LPNGenParams lpnGenparams = new LPNGenParams {
                        DocID = base.Request.QueryString["RECEIPTID"],
                        DocType = "IN",
                        Count = int.Parse(this.txtCount.Text),
                        GenerateType = base.GetValueFromAppSettings("LPNGenerateType")
                    };
                    string temp = CommoneMethodServiceClientProxy.GetInstance().LpnGenerateByGenerateType(lpnGenparams);
                    this.divMsg.InnerHtml = temp;
                }
                catch (Exception ex)
                {
                    this.lblMsg.Text = "生成错误:" + ex.Message;
                }
            }
            else
            {
                this.lblMsg.Text = "请输入生成个数！";
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
        }
    }
}

